package io.yunho.srw.pwebflux.routerfunction.domain;

import io.yunho.srw.pwebflux.routerfunction.domain.User;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

/**
 * @author: yunho
 * @date: 2021/5/12 17:03
 * @description:
 */
@Repository
public interface UserRepository extends ReactiveMongoRepository<User,String> {
    Flux<User> findByAgeBetween(int start, int end);
    @Query("{'age':{'$gte':30,'$lte':40}}")
    Flux<User> userOld();
}
